﻿using SelfMadeMillionaire.Core;
using SelfMadeMillionaire.Core.Entities;
using SelfMadeMillionaire.Core.Enums;
using SelfMadeMillionaire.Core.Repositories;
using SelfMadeMillionaire.Core.Services;
using SelfMadeMillionaire.Core.Specifications;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SelfMadeMillionaire.BLL.Services
{
	public class NewsProductService : INewsProductService
	{
		private readonly INewsProductRepository _NewsProductRepository;

        public NewsProductService(INewsProductRepository NewsProductRepository)
		{
            _NewsProductRepository = NewsProductRepository;
		}

        public IEnumerable<NewsProduct> GetByNews(int id)
        {
            return _NewsProductRepository.GetAll(x => x.News.ID == id);
        }

		public void Remove(int id)
		{
            _NewsProductRepository.Remove(id);
		}

		
	}
}
